package algorithms;

public class ShaaaAndOskols {

	static int n;
	static int[] counts = new int[n];
	
	static void shot(int x, int y) {
		
		if(n == 1) {
			counts[x -1] = 0;
			return;
		}
		
		int left = y - 1;
		int right = counts[x - 1] - left - 1;
		
		if(x - 1 != 0)
			counts[x - 2] += left;
		
		if(x != n)
			counts[x] += right;
		
		counts[x -1] = 0;
	}
	
	static void algo(int[] counts, int n, int[][] shots) {
		
	}
	
	
	public static void main(String []args) {
		n = 3;
		counts = new int[]{2 , 4 , 1};
		shot(1, 2);
		
		for (int i = 0; i < n; i++) {
			System.out.println(counts[i]);
		}
	}
	
}
